#include "Singletons.h"
#include "Hotel.h"
#include "BillRecord.h"


/* Static nullification */
Timer* 		Singletons::timer = NULL;
Hotel* 		Singletons::hotel = NULL;
BillRecord* Singletons::billRecord = NULL;
Date 		Singletons::currentDate = 0;


void Singletons::InstantiateSingletons() {
	if (!timer) {
		timer = new Timer;
	}
	
	if (!billRecord) {
		billRecord = new BillRecord;
	}

	currentDate = timer->hent_dato();
}

void Singletons::DeleteSingletons() {
	if (timer) {
		delete timer;
		timer = NULL;
	}
	
	if (hotel) {
		delete hotel;
		hotel = NULL;
	}
	
	if (billRecord) {
		delete billRecord;
		billRecord = NULL;
	}
}